cmake_minimum_required(VERSION 3.16)
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()
project(trdpmini)

find_library(pthread libpthread.so REQUIRED)

set(TRDPMINI_SRC src/msgQ.c src/trdp_mini.c vos/trdp_mini_vos.c)
set(TRDPMINI_INC api/trdp_mini.h api/trdp_mini_types.h config/trdp_mini_config.h)

include_directories(config)

add_library(trdpmini_a STATIC ${TRDPMINI_SRC})
add_library(trdpmini_so SHARED ${TRDPMINI_SRC})

set_target_properties(trdpmini_a PROPERTIES OUTPUT_NAME "trdpmini")
set_target_properties(trdpmini_so PROPERTIES OUTPUT_NAME "trdpmini")

target_link_libraries(trdpmini_a
	${pthread}
)

target_link_libraries(trdpmini_so
	${pthread}
)

install(
	TARGETS trdpmini_a trdpmini_so
	DESTINATION /usr/lib/${PROJECT_NAME}
)

install(
	FILES ${TRDPMINI_INC}
	DESTINATION /usr/include/${PROJECT_NAME}
)




